<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="恢复StatefulSet">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001792395376.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001792395420">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>恢复StatefulSet</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="ZH-CN_TOPIC_0000001792395420"></a><a name="ZH-CN_TOPIC_0000001792395420"></a>
  <h1 class="topictitle1">恢复StatefulSet</h1>
  <div>
   <p>当需要对已备份的StatefulSet恢复时，可以参考本节恢复StatefulSet至原位置或新位置。</p>
   <div class="section">
    <h4 class="sectiontitle">背景信息</h4>
    <p><span>本产品</span>支持使用备份副本、复制副本（不支持恢复至原StatefulSet）进行StatefulSet恢复，支持恢复至原位置或新位置。</p>
    <ul>
     <li>恢复至原位置<p>将副本中的PVC恢复到副本所在StatefulSet下相同卷的其他PVC中。</p></li>
     <li>恢复至新位置<p>支持恢复到以下新位置：</p>
      <ul>
       <li>恢复到副本所在的Kubernetes集群下相同命名空间的StatefulSet</li>
       <li>恢复到其他Kubernetes集群下命名空间的相同StatefulSet</li>
      </ul></li>
    </ul>
   </div>
   <div class="section">
    <h4 class="sectiontitle">前提条件</h4>
    <p>将StatefulSet恢复到其他Kubernetes集群时，需要先将其他Kubernetes集群注册到<span>本产品</span>中。注册操作请参见<a href="zh-cn_topic_0000001839274437.html">步骤1：注册集群</a>。</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">注意事项</h4>
    <ul>
     <li>执行跨POD恢复操作时，如果原POD业务正常，执行跨POD恢复操作将导致目标POD业务无法正常启动。建议在原POD故障场景下，执行跨POD恢复。</li>
     <li>恢复操作将停止目标StatefulSet中的所有POD，恢复完成后，系统会恢复所有POD。请确认目标POD上没有业务运行后进行恢复操作。</li>
     <li>Kubernetes主备环境下，在进行恢复操作时，如果自定义备份脚本中定义了备份备机，需要将当前默认备份数据的备机切换为主机，在备机上执行<strong>zcloud shutdown:maintain=yes</strong>命令，停止ZCloud服务，再执行恢复。</li>
    </ul>
   </div>
   <div class="section">
    <h4 class="sectiontitle">操作步骤</h4>
    <ol>
     <li><span>选择<span class="uicontrol" id="ZH-CN_TOPIC_0000001792395420__zh-cn_topic_0000001792395408_zh-cn_topic_0000001839142377_uicontrol9790142125420">“<span id="ZH-CN_TOPIC_0000001792395420__zh-cn_topic_0000001792395408_zh-cn_topic_0000001839142377_text1179013426540">数据利用</span> &gt; <span id="ZH-CN_TOPIC_0000001792395420__zh-cn_topic_0000001792395408_zh-cn_topic_0000001839142377_text67901428543">副本数据</span> &gt; <span id="ZH-CN_TOPIC_0000001792395420__zh-cn_topic_0000001792395408_zh-cn_topic_0000001839142377_text990214444212">容器</span> &gt; Kubernetes FlexVolume”</span>。</span></li>
     <li><span>支持以资源维度或以副本维度查找副本，本节以资源维度为例进行说明。</span><p></p><p>在“<span>资源</span>”页签，根据StatefulSet名称查找到需要恢复的StatefulSet，并单击StatefulSet名称。</p> <p></p></li>
     <li><span>在<span class="uicontrol">“<span>副本数据</span>”</span>页面，依次选择年、月、天找到副本。</span><p></p><p>当时间上显示<span><img src="zh-cn_image_0000001839274513.png"></span>，即表示该月、该天存在副本。</p> <p></p></li>
     <li><span>找到要恢复的副本，单击其右侧的“<span>更多</span> &gt; <span>恢复</span>”。</span></li>
     <li><span>恢复到原位置或新位置。</span><p></p>
      <ul>
       <li>恢复到原位置<p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001792395420__table52750616234">表1</a>所示。</p>
        <div class="tablenoborder">
         <a name="ZH-CN_TOPIC_0000001792395420__table52750616234"></a><a name="table52750616234"></a>
         <table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792395420__table52750616234" frame="border" border="1" rules="all">
          <caption>
           <b>表1 </b>恢复到原位置参数说明
          </caption>
          <colgroup>
           <col style="width:29.43%">
           <col style="width:70.57%">
          </colgroup>
          <thead align="left">
           <tr>
            <th align="left" class="cellrowborder" valign="top" width="29.43%" id="mcps1.3.5.2.5.2.1.1.2.2.3.1.1"><p>参数</p></th>
            <th align="left" class="cellrowborder" valign="top" width="70.57%" id="mcps1.3.5.2.5.2.1.1.2.2.3.1.2"><p>说明</p></th>
           </tr>
          </thead>
          <tbody>
           <tr>
            <td class="cellrowborder" valign="top" width="29.43%" headers="mcps1.3.5.2.5.2.1.1.2.2.3.1.1 "><p><span>卷对应关系</span>（<span>目标PVC</span>）</p></td>
            <td class="cellrowborder" valign="top" width="70.57%" headers="mcps1.3.5.2.5.2.1.1.2.2.3.1.2 "><p>选择恢复到的目标PVC卷。</p> <p>目标PVC卷的容量需要大于等于源PVC卷的容量，否则恢复将失败。</p></td>
           </tr>
          </tbody>
         </table>
        </div></li>
       <li>恢复到新位置
        <div class="p">
         相关参数说明如<a href="#ZH-CN_TOPIC_0000001792395420__table15668141795417">表2</a>所示。 
         <div class="tablenoborder">
          <a name="ZH-CN_TOPIC_0000001792395420__table15668141795417"></a><a name="table15668141795417"></a>
          <table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792395420__table15668141795417" frame="border" border="1" rules="all">
           <caption>
            <b>表2 </b>恢复到新位置参数说明
           </caption>
           <colgroup>
            <col style="width:29.87%">
            <col style="width:70.13000000000001%">
           </colgroup>
           <thead align="left">
            <tr>
             <th align="left" class="cellrowborder" valign="top" width="29.87%" id="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.1"><p>参数</p></th>
             <th align="left" class="cellrowborder" valign="top" width="70.13000000000001%" id="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.2"><p>说明</p></th>
            </tr>
           </thead>
           <tbody>
            <tr>
             <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.1 "><p><span>集群</span></p></td>
             <td class="cellrowborder" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.2 "><p>选择备份副本恢复到的集群。</p></td>
            </tr>
            <tr>
             <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.1 "><p><span>命名空间</span></p></td>
             <td class="cellrowborder" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.2 "><p>选择备份副本恢复到的命名空间。</p></td>
            </tr>
            <tr>
             <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.1 "><p><span>StatefulSet</span></p></td>
             <td class="cellrowborder" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.2 "><p>选择备份副本恢复到的命名空间下的StatefulSet。</p></td>
            </tr>
            <tr>
             <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.1 "><p><span>卷对应关系</span>（<span>目标PVC</span>）</p></td>
             <td class="cellrowborder" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.5.2.1.2.1.2.2.3.1.2 "><p>选择备份副本恢复到的StatefulSet下的目标PVC卷。</p> <p>目标PVC卷的容量需要大于等于备份副本中源PVC卷的容量，否则恢复将失败。</p></td>
            </tr>
           </tbody>
          </table>
         </div>
        </div></li>
      </ul> <p></p></li>
     <li><span>单击“<span>高级配置</span>”，配置高级参数信息。</span><p></p><p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001792395420__table17216329908">表3</a>所示。</p>
      <div class="tablenoborder">
       <a name="ZH-CN_TOPIC_0000001792395420__table17216329908"></a><a name="table17216329908"></a>
       <table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792395420__table17216329908" frame="border" border="1" rules="all">
        <caption>
         <b>表3 </b>高级参数说明
        </caption>
        <colgroup>
         <col style="width:29.87%">
         <col style="width:70.13000000000001%">
        </colgroup>
        <thead align="left">
         <tr>
          <th align="left" class="cellrowborder" valign="top" width="29.87%" id="mcps1.3.5.2.6.2.2.2.3.1.1"><p>参数</p></th>
          <th align="left" class="cellrowborder" valign="top" width="70.13000000000001%" id="mcps1.3.5.2.6.2.2.2.3.1.2"><p>说明</p></th>
         </tr>
        </thead>
        <tbody>
         <tr>
          <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.6.2.2.2.3.1.1 "><p><span>代理主机</span></p></td>
          <td class="cellrowborder" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.6.2.2.2.3.1.2 "><p>选择副本恢复时使用的代理主机。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.6.2.2.2.3.1.1 "><p><span>恢复前执行脚本</span></p></td>
          <td class="cellrowborder" rowspan="3" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.6.2.2.2.3.1.2 "><p><span style="color:#282B33;">请输入脚本的绝对路径，例如，“/opt/prescript.sh”。请确保脚本已存放在StatefulSet对应的POD中</span>。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" headers="mcps1.3.5.2.6.2.2.2.3.1.1 "><p><span>恢复成功执行脚本</span></p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" headers="mcps1.3.5.2.6.2.2.2.3.1.1 "><p><span>恢复失败执行脚本</span></p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="29.87%" headers="mcps1.3.5.2.6.2.2.2.3.1.1 "><p><span>恢复前执行副本校验</span></p></td>
          <td class="cellrowborder" valign="top" width="70.13000000000001%" headers="mcps1.3.5.2.6.2.2.2.3.1.2 "><p>开启后，副本恢复前将执行校验，校验副本的完整性。该操作将影响恢复性能。默认关闭。当未生成副本校验文件时，不支持开启。</p></td>
         </tr>
        </tbody>
       </table>
      </div> <p></p></li>
     <li><span>单击<span class="uicontrol">“<span>确定</span>”</span>。</span></li>
     <li><span>单击<span class="uicontrol">“<span>确定</span>”</span>。</span></li>
     <li><span>Kubernetes主备场景，恢复完成后，在恢复数据的POD中，执行<strong>zcloud recover as master</strong>命令，将恢复数据的POD置为主机。</span></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="zh-cn_topic_0000001792395376.html">恢复</a>
    </div>
   </div>
  </div>
 </body>
</html>